<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>标签设置</TITLE>
<style>	
	.userData{behavior:url(#default#userData);}
</style>
<SCRIPT language=javaScript src="/webprint/billprint/public.js">
</SCRIPT>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
var oEvent=window.dialogArguments
//oEvent为当前设置的对象块
var labelleft=oEvent.style.pixelLeft
var labeltop=oEvent.style.pixelTop

function window_onload() {
	LabelWidth.value =oEvent.offsetWidth
	SpaceBetween.value =parseInt(oEvent.style.letterSpacing)
	FontSize1.value =parseInt(oEvent.style.fontSize)
	var selface=oEvent.style.fontFamily
	var selbold=oEvent.style.fontWeight
	var selLine=oEvent.style.textDecoration
	var selItalic=oEvent.style.fontStyle
	var selcolor=oEvent.style.color
	var selalign=oEvent.style.textAlign
	for (var i=0;i<=8;i++){
		if (fontFace1.options(i) .value==selface)
			fontFace1.options(i).selected="true"
	}
	for (var i=0;i<=1;i++){
		if (boldfont.options(i) .value==selbold)
			boldfont.options(i).selected="true"
	}
	for (var i=0;i<=3;i++){
		if (LineFont.options(i) .value==selLine)
			LineFont.options(i).selected="true"
	}
	for (var i=0;i<=1;i++){
		if (FontItalic.options(i) .value==selItalic)
			FontItalic.options(i).selected="true"
	}
	for (var i=0;i<=7;i++){
		if (setcolor.options(i) .style.backgroundColor==selcolor)
			setcolor.options(i).selected="true"
	}
	for (var i=0;i<=2;i++){
		if (setalign.options(i) .value==selalign)
			setalign.options(i).selected="true"
	}

	
}
function LabelWidth_onclick() {

}
function checkFont(){
	if (LabelWidth.value ==""){
		LabelWidth.value =0
	}
	if (isNaN(LabelWidth.value)==true){
		LabelWidth.focus ()
		return
	}
	return false
}
function SetFontOK(){
	if (check()==false){
		return
	}
	if (LabelWidth.value ==""){
		LabelWidth.value =""
	}
	if (SpaceBetween.value !=parseInt(SpaceBetween.value)){
		SpaceBetween.value =parseInt(SpaceBetween.value)
	}	
	if (FontSize1.value !=parseInt(FontSize1.value)){
		FontSize1.value =parseInt(FontSize1.value)
	}	
	var setcolorIndex=setcolor.selectedIndex //颜色选择框中option的索引值
	var setalignIndex=setalign.selectedIndex //对齐方式索引值
	var fontfaceIndex=fontFace1.selectedIndex //字体的索引值
	var boldfontIndex=boldfont.selectedIndex //粗体的索引值
	var LineIndex=LineFont.selectedIndex //线选择框的索引值
	var ItalicIndex=FontItalic.selectedIndex //斜体选择框的索引值
	var fontReturn=new Array()
		fontReturn[0]=labelleft
		fontReturn[1]=labeltop
		fontReturn[2]=LabelWidth.value		
		fontReturn[3]=parseInt(SpaceBetween.value)
		fontReturn[4]=parseInt(FontSize1.value)
		fontReturn[5]=fontFace1.options .item(fontfaceIndex).value
		fontReturn[6]=boldfont.options .item(boldfontIndex).value//粗体
		fontReturn[7]=LineFont.options .item(LineIndex).value//下划线		
		fontReturn[8]=FontItalic.options .item(ItalicIndex).value//斜体
		fontReturn[9]=setcolor.options.item(setcolorIndex).style.backgroundColor//取出颜色选择框中option的背景颜色
		fontReturn[10]=setalign.options .item(setalignIndex).value	

	window.returnValue=fontReturn
	
	self.close()
}
function cmdOK_onclick() {
	SetFontOK()
}
function check(){
	if (isNaN(LabelWidth.value)==true){
		alert("请输入数字！")
		LabelWidth.value =""
		LabelWidth.focus ()
		return false			
	}	
	if (parseInt(LabelWidth.value) <=0){
		alert("标签宽度应大于零！")
		LabelWidth.value =""				
		LabelWidth.focus()
		return false
	}
	if (isNaN(SpaceBetween.value)==true){
		alert("请输入数字！")
		SpaceBetween.value =""
		SpaceBetween.focus ()
		return false			
	}				
	
	if (SpaceBetween.value <0){
		alert("字间距不能小于零！")
		SpaceBetween.value =""
		SpaceBetween.focus()
		return false
	}
	if (isNaN(FontSize1.value)==true){
		alert("请输入数字！")
		FontSize1.value =""
		FontSize1.focus ()
		return false			
	}				
	
	if (FontSize1.value <0){
		alert("文字大小不能小于零！")
		FontSize1.value =""				
		FontSize1.focus()
		return false
	}
	return true
}


function cmdCancel_onclick() {
	self.close ()
}

//-->
</SCRIPT>
</HEAD>
<BODY LANGUAGE=javascript onload="return window_onload()" bgcolor="#ded5cf">

<fieldset style="HEIGHT: 273px; LEFT: 25px; POSITION: absolute; TOP: 20px; WIDTH: 270px">
<legend style="FONT-SIZE: 14px" >标签设置</legend>
<TABLE border=0 cellPadding=1 cellSpacing=1 width="75%" style="FONT-SIZE: 13px; HEIGHT: 191px; LEFT: 27px; POSITION: absolute; TOP: 27px; WIDTH: 232px">
  
  <TR>
    <TD align=right>标签宽度：</TD>
    <TD><INPUT id=LabelWidth language=javascript name=text1 
      onclick="return LabelWidth_onclick()" 
    style="HEIGHT: 20px; WIDTH: 100px" width="100">PX</TD>
    <TD></TD></TR>
  
  <TR>
    <TD align=right>字间距：</TD>
    <TD><INPUT id=SpaceBetween name=text3 
    style="HEIGHT: 20px; WIDTH: 100px" width="100">PX</TD>
    <TD></TD></TR>
  <TR>
    <TD align=right>字体大小：</TD>
    <TD><INPUT id=FontSize1 name=text4 style="HEIGHT: 20px; WIDTH: 100px" width="100">PX</TD>
    <TD></TD></TR>
  <TR>
    <TD align=right>字体颜色：</TD>
    <TD><SELECT id=setcolor name=select3 style="HEIGHT: 22px; WIDTH: 100px">
		 <OPTION selected style="BACKGROUND-COLOR: black"></OPTION> 
		 <OPTION style="BACKGROUND-COLOR: blue"></OPTION> 
		 <OPTION style="BACKGROUND-COLOR: red"></OPTION> 
		 <OPTION style="BACKGROUND-COLOR: tomato"></OPTION> 
		 <OPTION style="BACKGROUND-COLOR: yellow"></OPTION> 
		 <OPTION style="BACKGROUND-COLOR: purple"></OPTION> 
		 <OPTION style="BACKGROUND-COLOR: navy"></OPTION> 
		 <OPTION style="BACKGROUND-COLOR: teal"></OPTION></SELECT></TD>
    <TD></TD></TR>
  <TR>
    <TD align=right> 字体粗细：</TD>
    <TD><SELECT id=boldfont name=select4 style="HEIGHT: 22px; WIDTH: 100px"> 
        <OPTION selected value=normal>正常</OPTION> <OPTION 
      value=bold>粗体</OPTION></SELECT></TD>
    <TD></TD></TR>
  <TR>
    <TD align=right>线条修饰：</TD>
    <TD><SELECT id=LineFont name=select5 style="HEIGHT: 22px; WIDTH: 100px"> 
        <OPTION selected value=none>正常</OPTION> 
        <OPTION value=overline>上划线</OPTION> 
        <OPTION value=line-through>删除线</OPTION> 
        <OPTION value=underline>下划线</OPTION></SELECT></TD>
    <TD></TD></TR>
  <TR>
    <TD align=right> 字体样式：</TD>
    <TD><SELECT id=FontItalic name=select6 style="HEIGHT: 22px; WIDTH: 100px"> 
        <OPTION selected value=normal>正常</OPTION> <OPTION 
        value=italic>斜体</OPTION></SELECT></TD>
    <TD></TD></TR>
  <TR>
    <TD align=right>字&nbsp; 体：</TD>
    <TD><SELECT id=fontFace1 name=select1 
      style="HEIGHT: 22px; WIDTH: 100px"> <OPTION value=serif>serif</OPTION> 
        <OPTION value=san-serif>san-serif</OPTION> <OPTION 
        value=cursive>cursive</OPTION> <OPTION value=fantasy>fantasy</OPTION> 
        <OPTION value=monospace>monospace</OPTION> <OPTION value=楷体>楷体</OPTION> 
        <OPTION value=宋体>宋体</OPTION> <OPTION value=隶书体>隶书体</OPTION> <OPTION 
        selected value=黑体>黑体</OPTION></SELECT></TD>
    <TD></TD></TR>
  <TR>
    <TD align=right>对齐方式：</TD>
    <TD><SELECT id=setalign name=select2 style="HEIGHT: 22px; WIDTH: 100px"> 
        <OPTION selected value=left>左对齐</OPTION> <OPTION 
        value=center>居中</OPTION> <OPTION value=right>右对齐</OPTION></SELECT></TD>
    <TD></TD></TR></TABLE>
    
    </fieldset>
<TABLE border=0 cellPadding=1 cellSpacing=1 width="75%" style="HEIGHT: 32px; LEFT: 90px; POSITION: absolute; TOP: 303px; WIDTH: 127px">
  
  <TR>
    <TD align=middle>
    <INPUT type="button" value="确&nbsp;&nbsp;定" id=cmdOK name=button1 LANGUAGE=javascript onclick="return cmdOK_onclick()"></TD>
    <TD></TD>
    <TD align=middle><INPUT id=cmdCancel name=cmdCancel type=button value="取&nbsp;&nbsp;消" LANGUAGE=javascript onclick="return cmdCancel_onclick()" ></TD></TR></TABLE>

</BODY>
</HTML>
